class ResourceController < ApplicationController

        
    def resources_edit
        render :layout => 'site'
    end   

    def resource_upload
        resource = Resource.new(@params[:resource])
        @site.resources << resource
        @site.save
        redirect_to :site_directory => @site, :action => 'resources_edit' 
    end
    
    def resources_delete
        ids_to_delete = @params[:delete].delete_if {|k,v| v == "0"}
        ids_to_delete.each_key { |key| Resource.destroy key }
        redirect_to :site_directory => @site, :action => 'resources_edit' 
    end
end